#ifndef GAMEOBJECT_H
#define GAMEOBJECT_H

#include "Entity.h"
#include "GameObjectID.h"
#include "Sprite.h"
#include "ResourceManager.h"
#include <string>
#include <cmath>

using namespace std;

class ResourceManager;
class GameObject:
	public CEntity
{
private:
	int m_id;
	GameObID m_gameObID;
	bool m_alive;
	bool m_isRight; // huong true = pai,
	bool m_changeAni; // thay doi ani
	int m_life;	
	bool m_isRun; // bat dau chuyen dong 

public:
	LPD3DXSPRITE m_spriteHandler;
	CCamera *m_camera;
	CSprite *m_sprite;

	GameObject();	
	GameObject(int id, float posX, float posY,int width, int height);
	~GameObject();

	virtual void init();
	virtual void update(float time);
	virtual void setAnimation();
	virtual void setRectCollsion();
	virtual void draw();
	virtual void destroy();

	void setID(int x){ m_id = x; }
	int getID(){ return m_id; }
	void setAlive(bool x){ m_alive = x; }
	bool isAlive(){ return m_alive; }
	bool isRight(){ return m_isRight; }
	void isRight(bool x){ m_isRight = x; }
	bool isChangeAni(){ return m_changeAni; }
	void isChangeAni(bool x){ m_changeAni = x; }
	void setGameObID(GameObID x){ m_gameObID = x; }
	void setLife(int x){ m_life = x; }
	int getLife(){ return m_life; }
	bool isRun(){ return m_isRun; }
	void isRun(bool x){ m_isRun = x; }


	void setGameObID(string x);
	virtual GameObID getGameObID(){ return m_gameObID; }

};


#endif